package com.atguigu.lease.web.app.mapper;

import com.atguigu.lease.model.entity.RoomInfo;
import com.atguigu.lease.web.app.vo.room.RoomItemVo;
import com.atguigu.lease.web.app.vo.room.RoomQueryVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

/**
* @author liubo
* @description 针对表【room_info(房间信息表)】的数据库操作Mapper
* @createDate 2023-07-26 11:12:39
* @Entity com.atguigu.lease.model.entity.RoomInfo
*/
public interface RoomInfoMapper extends BaseMapper<RoomInfo> {

    //分页查询房间列表
    IPage<RoomItemVo> findRoomItemVoPage(@Param("page") IPage<RoomItemVo> page, @Param("queryVo") RoomQueryVo queryVo);
    //根据id查询全部的房间信息（！！！包括被删除的！！！）
    RoomInfo selectAllById(Long id);
    //根据公寓id分页查询房间列表
    IPage<RoomItemVo> findRoomItemVoPageByApartmentId(@Param("page") IPage<RoomItemVo> page, @Param("id") Long id);

    BigDecimal selectMinRentByApartmentId(Long id);

    String findRoomNumberById(@Param("roomId") Long roomId);
}